package com.liangzhong.view.tips
{
	import com.common.utils.DisplayObjectUtil;
	import com.common.utils.Reflection;
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.club.vo.NpcClubInfoVo;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import lz.controls.ImageContain;
	import lz.controls.tips.ITip;

	/**
	 *队伍信息tips 
	 * @author lake
	 * 
	 */	
	public class TeamInfoTips extends Sprite implements ITip
	{
		/**
		 *静态全局公用 
		 */		
		public static var symbolSkin		:MovieClip;//皮肤
		/**
		 *队徽 
		 */		
		private static var img 			:ImageContain ;
		/**
		 * 数据
		 */		
		private var _data :Object;
		
		public function TeamInfoTips()
		{
			super();
		}
		/**
		 *获取设置数据 
		 * @return 
		 * 
		 */		
		public function get data():Object
		{
			return null;
		}
		public function set data(value:Object):void
		{
			_data = value;
			if(symbolSkin == null)
			{
				symbolSkin = Reflection.createInstance("com.football.res.teamInfoSkin");
			}
			this.addChild(symbolSkin);
			symbolSkin.mouseChildren = false;
			symbolSkin.mouseEnabled = false;
			symbolSkin.txtDesc.htmlText = _data.desc + "";
			symbolSkin.txtName.htmlText = _data.name + "";
			symbolSkin.starLv.gotoAndStop(_data.level);
			DisplayObjectUtil.removeAllChildren(symbolSkin.starContainer)
			DisplayObjectUtil.removeAllChildren(symbolSkin.iconContainer)
			var iconContainer :Sprite = new Sprite();
			var starIds :Array = _data.starIds;
			var i :int = 0;
			var item :*;
			for each(var starId :int in starIds)
			{
				item = Reflection.createInstance("common.item.ComGoodsItem");
				item.initUI();
				item.data = AppData.getInstance().goodsManager.getStarById(starId);
				symbolSkin.starContainer.addChild(item);
				item.x = i * (item.width + 3);
				i++;
			}
			if(img == null)
			{
				img = new ImageContain();
				img.setSize(125,125);
			}
			img.url = _data.teamUrl;
			symbolSkin.iconContainer.addChild(img);
		}
		/**
		 *销毁 
		 * 
		 */		
		public function destroy():void
		{
			_data = null;
		}
	}
}